;--------------------------------------------------------
; File Created by SDCC : free open source ANSI-C Compiler
; Version 3.7.1 #0 (MSVC)
;--------------------------------------------------------
; NY8A port
;--------------------------------------------------------
	.file	"mcu\NY8\mcu_delay.c"
	list	p=NY8B062E,c=on
	#include "ny8b062e.inc"
	.debuginfo language C89
;--------------------------------------------------------
; external declarations
;--------------------------------------------------------
	extern	_sinf
	extern	_cosf
	extern	_tanf
	extern	_cotf
	extern	_asinf
	extern	_acosf
	extern	_atanf
	extern	_atan2f
	extern	_sinhf
	extern	_coshf
	extern	_tanhf
	extern	_expf
	extern	_logf
	extern	_log10f
	extern	_powf
	extern	_sqrtf
	extern	_fabsf
	extern	_frexpf
	extern	_ldexpf
	extern	_ceilf
	extern	_floorf
	extern	_modff
	extern	_isnan
	extern	_isinf
	extern	_multi_16b
	extern	_read_14bit_rom
	extern	_Adc_Start
	extern	_Adc_SetVref
	extern	_Adc_GetOnce
	extern	_PORTAbits
	extern	_PORTBbits
	extern	_PCONbits
	extern	_BWUCONbits
	extern	_ABPLCONbits
	extern	_BPHCONbits
	extern	_INTEbits
	extern	_INTFbits
	extern	_ADMDbits
	extern	_ADRbits
	extern	_ADVREFHbits
	extern	_ADCRbits
	extern	_AWUCONbits
	extern	_PACONbits
	extern	_ADJMDbits
	extern	_INTEDGbits
	extern	_ANAENbits
	extern	_RFCbits
	extern	_INTE2bits
	extern	__Adc_mDiscard
	extern	_INDF
	extern	_TMR0
	extern	_PCL
	extern	_STATUS
	extern	_FSR
	extern	_PORTA
	extern	_PORTB
	extern	_PCON
	extern	_BWUCON
	extern	_PCHBUF
	extern	_ABPLCON
	extern	_BPHCON
	extern	_INTE
	extern	_INTF
	extern	_ADMD
	extern	_ADR
	extern	_ADD
	extern	_ADVREFH
	extern	_ADCR
	extern	_AWUCON
	extern	_PACON
	extern	_ADJMD
	extern	_INTEDG
	extern	_TMRH
	extern	_ANAEN
	extern	_RFC
	extern	_TM3RH
	extern	_INTE2
	extern	_TMR1
	extern	_T1CR1
	extern	_T1CR2
	extern	_PWM1DUTY
	extern	_PS1CV
	extern	_BZ1CR
	extern	_IRCR
	extern	_TBHP
	extern	_TBHD
	extern	_TMR2
	extern	_T2CR1
	extern	_T2CR2
	extern	_PWM2DUTY
	extern	_PS2CV
	extern	_BZ2CR
	extern	_OSCCR
	extern	_TMR3
	extern	_T3CR1
	extern	_T3CR2
	extern	_PWM3DUTY
	extern	_PS3CV
	extern	_BZ3CR
	extern	_P4CR1
	extern	_PWM4DUTY
	extern	_IOSTA
	extern	_IOSTB
	extern	_APHCON
	extern	_PS0CV
	extern	_BODCON
	extern	_CMPCR
	extern	_PCON1
	extern	_T0MD

	extern PSAVE
	extern SSAVE
	extern WSAVE
	extern STK04
	extern STK03
	extern STK02
	extern STK01
	extern STK00
;--------------------------------------------------------
; global declarations
;--------------------------------------------------------
	extern	_Mcu_Delayms
	extern	_Mcu_Delayus

;--------------------------------------------------------
; global definitions
;--------------------------------------------------------
;--------------------------------------------------------
; absolute symbol definitions
;--------------------------------------------------------
;--------------------------------------------------------
; compiler-defined variables
;--------------------------------------------------------
.segment "uninit"
r0x1001:
	.res	1
.segment "uninit"
r0x1000:
	.res	1
.segment "uninit"
r0x1002:
	.res	1
.segment "uninit"
r0x1003:
	.res	1
.segment "uninit"
r0x1005:
	.res	1
.segment "uninit"
r0x1004:
	.res	1
.segment "uninit"
r0x1006:
	.res	1
.segment "uninit"
r0x1007:
	.res	1
;--------------------------------------------------------
; initialized data
;--------------------------------------------------------
;--------------------------------------------------------
; overlayable items in internal ram 
;--------------------------------------------------------
;	udata_ovr
;--------------------------------------------------------
; code
;--------------------------------------------------------
;***
;  pBlock Stats: dbName = C
;***
;has an exit
;functions called:
;   _Mcu_Delayus
;   _Mcu_Delayus
;5 compiler assigned registers:
;   r0x1004
;   STK00
;   r0x1005
;   r0x1006
;   r0x1007
;; Starting pCode block
.segment "code"; module=mcu_delay, function=_Mcu_Delayms
	.debuginfo subprogram _Mcu_Delayms
_Mcu_Delayms:
; 2 exit points
	.line	24, "mcu\NY8\mcu_delay.c"; 	void Mcu_Delayms(u16 ms)
	BANKSEL	r0x1004
	MOVAR	r0x1004
	MOVR	STK00,W
	BANKSEL	r0x1005
	MOVAR	r0x1005
_00113_DS_:
	.line	26, "mcu\NY8\mcu_delay.c"; 	while(ms--)
	BANKSEL	r0x1005
	MOVR	r0x1005,W
	BANKSEL	r0x1006
	MOVAR	r0x1006
	BANKSEL	r0x1004
	MOVR	r0x1004,W
	BANKSEL	r0x1007
	MOVAR	r0x1007
	MOVIA	0xff
	BANKSEL	r0x1005
	ADDAR	r0x1005,F
	BTRSC	STATUS,0
	MGOTO	_00001_DS_
	BANKSEL	r0x1004
	DECR	r0x1004,F
_00001_DS_:
	BANKSEL	r0x1006
	MOVR	r0x1006,W
	BANKSEL	r0x1007
	IORAR	r0x1007,W
	BTRSC	STATUS,2
	MGOTO	_00116_DS_
	.line	28, "mcu\NY8\mcu_delay.c"; 	Mcu_Delayus(1000);
	MOVIA	0xe8
	MOVAR	STK00
	MOVIA	0x03
	MCALL	_Mcu_Delayus
	MGOTO	_00113_DS_
_00116_DS_:
	.line	30, "mcu\NY8\mcu_delay.c"; 	}
	RETURN	
; exit point of _Mcu_Delayms

;***
;  pBlock Stats: dbName = C
;***
;has an exit
;5 compiler assigned registers:
;   r0x1000
;   STK00
;   r0x1001
;   r0x1002
;   r0x1003
;; Starting pCode block
.segment "code"; module=mcu_delay, function=_Mcu_Delayus
	.debuginfo subprogram _Mcu_Delayus
_Mcu_Delayus:
; 2 exit points
	.line	15, "mcu\NY8\mcu_delay.c"; 	void Mcu_Delayus(u16 us)
	BANKSEL	r0x1000
	MOVAR	r0x1000
	MOVR	STK00,W
	BANKSEL	r0x1001
	MOVAR	r0x1001
_00105_DS_:
	.line	17, "mcu\NY8\mcu_delay.c"; 	while(us--)
	BANKSEL	r0x1001
	MOVR	r0x1001,W
	BANKSEL	r0x1002
	MOVAR	r0x1002
	BANKSEL	r0x1000
	MOVR	r0x1000,W
	BANKSEL	r0x1003
	MOVAR	r0x1003
	MOVIA	0xff
	BANKSEL	r0x1001
	ADDAR	r0x1001,F
	BTRSC	STATUS,0
	MGOTO	_00002_DS_
	BANKSEL	r0x1000
	DECR	r0x1000,F
_00002_DS_:
	BANKSEL	r0x1002
	MOVR	r0x1002,W
	BANKSEL	r0x1003
	IORAR	r0x1003,W
	BTRSC	STATUS,2
	MGOTO	_00108_DS_
	.line	19, "mcu\NY8\mcu_delay.c"; 	CLRWDT();
	clrwdt
	MGOTO	_00105_DS_
_00108_DS_:
	.line	21, "mcu\NY8\mcu_delay.c"; 	}
	RETURN	
; exit point of _Mcu_Delayus


;	code size estimation:
;	   40+   20 =    60 instructions (  160 byte)

	end
